import java.lang.reflect.Array;
import java.util.Scanner;


public class Sequence 
{
	public static void main (String ARGC[])
	{
		int arr[] = {1,1,2,2,3,3,3,3,3,3,3,4,4,4,4,3};
		
		int maxNum = maxSequence(arr);
		
		System.out.println( "Largest Sequence value is:"+maxNum);
		
		
		boolean t = countCharInString("shooo ada", 'a');
		System.out.println(t);
		
		
		
		printInitials("Jhonnn      sl");
		
	}
	
	public static int maxSequence(int[] a)
	{
		
		int numberValue = a[0];
		//Number of sequence
		int numberSeq = 1;
		int tmpSeq=1;
		for (int i=0;i<a.length-1;i++)
		{
			System.out.println(i+"\n");
			
			if(a[i]==a[i+1])
			{
				
				if (tmpSeq > numberSeq)
				{
					numberSeq = tmpSeq;
					numberValue=a[i];
				}
				tmpSeq++;
				
			}
			else
			{
				tmpSeq=1;
			}
		}
		
		return numberValue;
		
		
	}
	
	
	
	public static boolean countCharInString(String st,char ch)
	{
		int count=0;
		
		for (int i=0;i<st.length();i++)
			if( st.charAt(i) == ch )
				count++;
	
		if(count>0)
		{
			System.out.println("Number of "+ch+" In String "+st+" is "+count);
			return true;
		}
		
		return false;
	}
	
	
	public static boolean isPolydrom(String st)
	{
		//first Char
		int inxAsc = 0;
		
		//Last Char
		int inxDesc = st.length()-1;
		
		boolean isPoly = true;
		
		while (inxAsc<inxDesc && isPoly)
		{
			if (st.charAt(inxAsc)!= st.charAt(inxDesc))
			{
				isPoly=false;
			}
			inxAsc++;
			inxDesc--;
			
		}
		
		return isPoly;
		
	}
	
	
	public static void printInitials(String st)
	{
		char First = st.charAt(0);
		
				
		//look for the first Seperator
		int inx = st.indexOf(' ');
		
		while(inx<st.length() && st.charAt(inx) == ' ')
			inx++;
		
		char Second = st.charAt(inx);
		
		System.out.println(First+"."+Second);
		
		
		
	}
	
	/**
	 * Count number of words at the given string	
	 * @param st
	 * @return
	 */
	public static int numbOfWords(String st)
	{
		int count=0;
		
		//word boundry
		
		
		return count;
		
	}
	
	
}